<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<h1>object example</h1>
<script>
	function Member(){
		/* 필드를 정의할때는 반드시 this를 사용해야함 반드시*/
		
		this.irum = "park";
		this.age = 19;
		this.address = "seoul";
		this.score = 90;
		// getter & setter 정의
		this.setIrum = function(v){this.irum = v;}
		this.setAge = function(v){this.age = v;}
		this.setAddress = function(v){this.address = v;}
		this.setScore = function(v){this.score = v;}
		
		this.getIrum = function(){return this.irum;}
		this.getAge = function(){return this.age;}
		this.getAddress = function(){return this.address;}
		this.getScore = function(){return this.score;}
	}
	
	
	
	var m = new Member();
	document.write(m.irum);
</script>
</body>
</html>